<template>
  <div>
    <van-nav-bar
      title="分类详情"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <div class="box" v-html="list.content" style="width: 100%"></div>
    <div class="list">
      <p class="title">专题推荐</p>
      <div class="item" v-for="item in recommendList" :key="item.id">
        <img :src="item.scene_pic_url" alt="" />
        <p>{{ item.title }}</p>
      </div>
    </div>
  </div>
</template>

<script>
import { detailaction } from "@/api/topic/details/index.js";
export default {
  props: {},
  data() {
    return {
      list: [],
      recommendList: [],
    };
  },
  computed: {},
  created() {
    const id = this.$route.query.ids;
    console.log(id);
    detailaction({
      id: id,
    }).then((res) => {
      console.log(res);
      this.list = res.data;
      this.recommendList = res.recommendList;
      // this.obj=res.data
      // this.goodsList=res.goodsList
      // this.num=this.goodsList.length
    });
  },
  mounted() {},
  watch: {},
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
  components: {},
};
</script>

<style lang="scss" scoped>
.list {
  width: 345px;
  height: auto;
  margin: 0 15px;
  .title {
    text-align: center;
    background: #f4f4f4;
    font-size: 15px;
    color: #999;
    padding: 15px 0;
  }
  .item {
    width: 100%;
    padding: 12px 12px 15px 12px;
    margin-bottom: 15px;
    background: #fff;
    box-sizing: border-box;
    img {
      height: 140px;
      width: 321px;
      display: block;
    }
    p {
      display: block;
      margin-top: 15px;
      font-size: 12px;
    }
  }
}
</style>
<style >
.box img {
  display: block;
  max-width: 100%;
}
</style>
